

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>yubihsm package &mdash; python-yubihsm 2.1.0 documentation</title>
  

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script src="../_static/jquery.js"></script>
        <script src="../_static/underscore.js"></script>
        <script src="../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> python-yubihsm
          

          
          </a>

          
            
            
              <div class="version">
                2.1
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <!-- Local TOC -->
              <div class="local-toc"><ul>
<li><a class="reference internal" href="#">yubihsm package</a><ul>
<li><a class="reference internal" href="#subpackages">Subpackages</a></li>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-yubihsm.core">yubihsm.core module</a></li>
<li><a class="reference internal" href="#module-yubihsm.defs">yubihsm.defs module</a></li>
<li><a class="reference internal" href="#module-yubihsm.eddsa">yubihsm.eddsa module</a></li>
<li><a class="reference internal" href="#module-yubihsm.exceptions">yubihsm.exceptions module</a></li>
<li><a class="reference internal" href="#module-yubihsm.objects">yubihsm.objects module</a></li>
<li><a class="reference internal" href="#module-yubihsm.utils">yubihsm.utils module</a></li>
<li><a class="reference internal" href="#module-yubihsm">Module contents</a></li>
</ul>
</li>
</ul>
</div>
            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">python-yubihsm</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
        
      <li>yubihsm package</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="yubihsm-package">
<h1>yubihsm package<a class="headerlink" href="#yubihsm-package" title="Permalink to this headline">¶</a></h1>
<div class="section" id="subpackages">
<h2>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
</div>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h2>
</div>
<div class="section" id="module-yubihsm.core">
<span id="yubihsm-core-module"></span><h2>yubihsm.core module<a class="headerlink" href="#module-yubihsm.core" title="Permalink to this headline">¶</a></h2>
<p>Core classes for YubiHSM communication.</p>
<dl class="py class">
<dt id="yubihsm.core.AuthSession">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.core.</span></code><code class="sig-name descname"><span class="pre">AuthSession</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">hsm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">auth_key_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_enc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_mac</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>An authenticated secure session with a YubiHSM.</p>
<p>Typically you get an instance of this class by calling
<a class="reference internal" href="#yubihsm.core.YubiHsm.create_session" title="yubihsm.core.YubiHsm.create_session"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_session()</span></code></a> or <a class="reference internal" href="#yubihsm.core.YubiHsm.create_session_derived" title="yubihsm.core.YubiHsm.create_session_derived"><code class="xref py py-func docutils literal notranslate"><span class="pre">create_session_derived()</span></code></a>.</p>
<dl class="py method">
<dt id="yubihsm.core.AuthSession.close">
<code class="sig-name descname"><span class="pre">close</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close this session with the YubiHSM.</p>
<p>Once closed, this session object can no longer be used, unless re-connected.</p>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_command_audit">
<code class="sig-name descname"><span class="pre">get_command_audit</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_command_audit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_command_audit" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a mapping of all available commands and their audit settings.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Dictionary of COMMAND -&gt; AUDIT pairs.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)">dict</a>[<a class="reference internal" href="#yubihsm.defs.COMMAND" title="yubihsm.defs.COMMAND">COMMAND</a>, <a class="reference internal" href="#yubihsm.defs.AUDIT" title="yubihsm.defs.AUDIT">AUDIT</a>]</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_force_audit">
<code class="sig-name descname"><span class="pre">get_force_audit</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_force_audit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_force_audit" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the current setting for forced audit mode.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The AUDIT setting for FORCE_AUDIT.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#yubihsm.defs.AUDIT" title="yubihsm.defs.AUDIT">AUDIT</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_log_entries">
<code class="sig-name descname"><span class="pre">get_log_entries</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">previous_entry</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_log_entries"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_log_entries" title="Permalink to this definition">¶</a></dt>
<dd><p>Get logs from the YubiHSM.</p>
<p>This returns a tuple of the number of unlogged boot events, the number
of unlogged authentication events, and the log entries from the YubiHSM.
The chain of entry digests will be validated, starting from the first
entry returned, or the one supplied as previous_entry.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>previous_entry</strong> (<a class="reference internal" href="#yubihsm.core.LogEntry" title="yubihsm.core.LogEntry"><em>LogEntry</em></a>) – (optional) Entry to start verification
against.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A tuple consisting of the number of unlogged boot and
authentication events, and the list of log entries.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.LogData" title="yubihsm.core.LogData">LogData</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_object">
<code class="sig-name descname"><span class="pre">get_object</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_type</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_object"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_object" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a reference to a YhsmObject with the given id and type.</p>
<p>The object returned will be a subclass of YhsmObject corresponding to
the given object_type.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the object to retrieve.</p></li>
<li><p><strong>object_type</strong> (<a class="reference internal" href="#yubihsm.defs.OBJECT" title="yubihsm.defs.OBJECT"><em>OBJECT</em></a>) – The type of the object to retrieve.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An object reference.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject">YhsmObject</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_option">
<code class="sig-name descname"><span class="pre">get_option</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">option</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_option"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_option" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the raw value of a YubiHSM device option.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>option</strong> (<a class="reference internal" href="#yubihsm.defs.OPTION" title="yubihsm.defs.OPTION"><em>OPTION</em></a>) – The OPTION to get.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The currently set value for the given OPTION</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.get_pseudo_random">
<code class="sig-name descname"><span class="pre">get_pseudo_random</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">length</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.get_pseudo_random"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.get_pseudo_random" title="Permalink to this definition">¶</a></dt>
<dd><p>Get bytes from YubiHSM PRNG.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The number of bytes to return.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The requested number of random bytes.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.list_objects">
<code class="sig-name descname"><span class="pre">list_objects</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">object_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_type</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.list_objects"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.list_objects" title="Permalink to this definition">¶</a></dt>
<dd><p>List objects from the YubiHSM.</p>
<p>This returns a list of all objects currently stored on the YubiHSM,
which are accessible by this session. The arguments to this method can
be used to filter the results returned.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – (optional) Return only objects with this ID.</p></li>
<li><p><strong>object_type</strong> (<a class="reference internal" href="#yubihsm.defs.OBJECT" title="yubihsm.defs.OBJECT"><em>OBJECT</em></a>) – (optional) Return only objects of this type.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – (optional) Return only objects belonging to one or
more of these domains.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – (optional) Return only objects with one or more
of these capabilities.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – (optional) Return only objects with this
algorithm.</p></li>
<li><p><strong>label</strong> – (optional) Return only objects with this label.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A list of matched objects.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)">list</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.put_option">
<code class="sig-name descname"><span class="pre">put_option</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">option</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.put_option"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.put_option" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the raw value of a YubiHSM device option.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>option</strong> (<a class="reference internal" href="#yubihsm.defs.OPTION" title="yubihsm.defs.OPTION"><em>OPTION</em></a>) – The OPTION to set.</p></li>
<li><p><strong>value</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The value to set the OPTION to.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.reset_device">
<code class="sig-name descname"><span class="pre">reset_device</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.reset_device"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.reset_device" title="Permalink to this definition">¶</a></dt>
<dd><p>Performs a factory reset of the YubiHSM.</p>
<p>Resets and reboots the YubiHSM, deletes all Objects and restores the
default Authkey.</p>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.send_secure_cmd">
<code class="sig-name descname"><span class="pre">send_secure_cmd</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">b''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.send_secure_cmd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.send_secure_cmd" title="Permalink to this definition">¶</a></dt>
<dd><p>Send a command over the encrypted session.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd</strong> (<a class="reference internal" href="#yubihsm.defs.COMMAND" title="yubihsm.defs.COMMAND"><em>COMMAND</em></a>) – The command to send.</p></li>
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The command payload to send.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The decrypted response data from the YubiHSM.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.set_command_audit">
<code class="sig-name descname"><span class="pre">set_command_audit</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">commands</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.set_command_audit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.set_command_audit" title="Permalink to this definition">¶</a></dt>
<dd><p>Set audit mode of commands.</p>
<p>Takes a dict of COMMAND -&gt; AUDIT pairs and updates the audit settings
for the commands given.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>commands</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#dict" title="(in Python v3.9)"><em>dict</em></a><em>[</em><a class="reference internal" href="#yubihsm.defs.COMMAND" title="yubihsm.defs.COMMAND"><em>COMMAND</em></a><em>, </em><a class="reference internal" href="#yubihsm.defs.AUDIT" title="yubihsm.defs.AUDIT"><em>AUDIT</em></a><em>]</em>) – Settings to update.</p>
</dd>
<dt class="field-even">Example</dt>
<dd class="field-even"><p></p></dd>
</dl>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">session</span><span class="o">.</span><span class="n">set_comment_audit</span><span class="p">({</span>
<span class="gp">... </span>    <span class="n">COMMAND</span><span class="o">.</span><span class="n">ECHO</span><span class="p">:</span> <span class="n">AUDIT</span><span class="o">.</span><span class="n">OFF</span><span class="p">,</span>
<span class="gp">... </span>    <span class="n">COMMAND</span><span class="o">.</span><span class="n">LIST_OBJECTS</span><span class="p">:</span> <span class="n">AUDIT</span><span class="o">.</span><span class="n">ON</span>
<span class="gp">... </span><span class="p">})</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.set_force_audit">
<code class="sig-name descname"><span class="pre">set_force_audit</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">audit</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.set_force_audit"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.set_force_audit" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the FORCE_AUDIT mode of the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>audit</strong> (<a class="reference internal" href="#yubihsm.defs.AUDIT" title="yubihsm.defs.AUDIT"><em>AUDIT</em></a>) – The AUDIT mode to set.</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.set_log_index">
<code class="sig-name descname"><span class="pre">set_log_index</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">index</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#AuthSession.set_log_index"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.AuthSession.set_log_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Clears logs to free up space for use with forced audit.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>index</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The log entry index to clear up to (inclusive).</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.AuthSession.sid">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">sid</span></code><a class="headerlink" href="#yubihsm.core.AuthSession.sid" title="Permalink to this definition">¶</a></dt>
<dd><p>Session ID</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The ID of the session.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)">int</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.core.DeviceInfo">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.core.</span></code><code class="sig-name descname"><span class="pre">DeviceInfo</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">version</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">serial</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log_size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log_used</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">supported_algorithms</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#DeviceInfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.DeviceInfo" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.core.DeviceInfo" title="yubihsm.core.DeviceInfo"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.core.DeviceInfo</span></code></a></p>
<p>Data class holding various information about the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>version</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)"><em>tuple</em></a><em>[</em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>, </em><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a><em>]</em>) – YubiHSM version tuple.</p></li>
<li><p><strong>serial</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – YubiHSM serial number.</p></li>
<li><p><strong>log_size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Log entry storage capacity.</p></li>
<li><p><strong>log_used</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Log entries currently stored.</p></li>
<li><p><strong>supported_algorithms</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#set" title="(in Python v3.9)"><em>set</em></a><em>[</em><a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a><em>]</em>) – List of supported algorithms.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="yubihsm.core.DeviceInfo.FORMAT">
<code class="sig-name descname"><span class="pre">FORMAT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'!BBBIBB'</span></em><a class="headerlink" href="#yubihsm.core.DeviceInfo.FORMAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.core.DeviceInfo.LENGTH">
<code class="sig-name descname"><span class="pre">LENGTH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">9</span></em><a class="headerlink" href="#yubihsm.core.DeviceInfo.LENGTH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.core.DeviceInfo.parse">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">parse</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#DeviceInfo.parse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.DeviceInfo.parse" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse a DeviceInfo from its binary representation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – Binary data to unpack from.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The parsed object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.DeviceInfo" title="yubihsm.core.DeviceInfo">DeviceInfo</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.core.LogData">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.core.</span></code><code class="sig-name descname"><span class="pre">LogData</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n_boot</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n_auth</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">entries</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#LogData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.LogData" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.core.LogData" title="yubihsm.core.LogData"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.core.LogData</span></code></a></p>
<p>Data class holding response data from a GET_LOGS command.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>n_boot</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Number of unlogged boot events.</p></li>
<li><p><strong>n_auth</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – Number of unlogged authentication events.</p></li>
<li><p><strong>entries</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#list" title="(in Python v3.9)"><em>list</em></a><em>[</em><a class="reference internal" href="#yubihsm.core.LogEntry" title="yubihsm.core.LogEntry"><em>LogEntry</em></a><em>]</em>) – List of LogEntry items.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="yubihsm.core.LogEntry">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.core.</span></code><code class="sig-name descname"><span class="pre">LogEntry</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">number</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">command</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">length</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">session_key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">target_key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">second_key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">result</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">tick</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">digest</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#LogEntry"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.LogEntry" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.core.LogEntry" title="yubihsm.core.LogEntry"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.core.LogEntry</span></code></a></p>
<p>YubiHSM log entry.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>number</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The sequence number of the entry.</p></li>
<li><p><strong>command</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The COMMAND executed.</p></li>
<li><p><strong>length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The length of the command.</p></li>
<li><p><strong>session_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the Authentication Key for the session.</p></li>
<li><p><strong>target_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the key used by the command.</p></li>
<li><p><strong>second_key</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the secondary key used by the command, if
applicable.</p></li>
<li><p><strong>result</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The result byte of the response.</p></li>
<li><p><strong>tick</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The YubiHSM system tick value when the command was run.</p></li>
<li><p><strong>digest</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – A truncated hash of the entry and previous digest.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="yubihsm.core.LogEntry.FORMAT">
<code class="sig-name descname"><span class="pre">FORMAT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'!HBHHHHBL16s'</span></em><a class="headerlink" href="#yubihsm.core.LogEntry.FORMAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.core.LogEntry.LENGTH">
<code class="sig-name descname"><span class="pre">LENGTH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">32</span></em><a class="headerlink" href="#yubihsm.core.LogEntry.LENGTH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.core.LogEntry.data">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">data</span></code><a class="headerlink" href="#yubihsm.core.LogEntry.data" title="Permalink to this definition">¶</a></dt>
<dd><p>Get log entry binary data.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The binary LogEntry data, excluding the digest.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.LogEntry.parse">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">parse</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#LogEntry.parse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.LogEntry.parse" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse a LogEntry from its binary representation.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – Binary data to unpack from.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The parsed object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.LogEntry" title="yubihsm.core.LogEntry">LogEntry</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.LogEntry.validate">
<code class="sig-name descname"><span class="pre">validate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">previous_entry</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#LogEntry.validate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.LogEntry.validate" title="Permalink to this definition">¶</a></dt>
<dd><p>Validate the hash of a single log entry.</p>
<p>Validates the hash of this entry with regard to the previous entry’s
hash. The previous entry is the LogEntry with the previous number,
previous_entry.number == self.number - 1</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>previous_entry</strong> (<a class="reference internal" href="#yubihsm.core.LogEntry" title="yubihsm.core.LogEntry"><em>LogEntry</em></a>) – The previous log entry to validate
against.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if the digest is correct, False if not.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.core.YubiHsm">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.core.</span></code><code class="sig-name descname"><span class="pre">YubiHsm</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">backend</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>An unauthenticated connection to a YubiHSM.</p>
<dl class="py method">
<dt id="yubihsm.core.YubiHsm.close">
<code class="sig-name descname"><span class="pre">close</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.close"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect from the backend, freeing any resources in use by it.</p>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.YubiHsm.connect">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">connect</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">url</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.connect"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a YubiHsm connected to the backend specified by the URL.</p>
<p>If no URL is given this will attempt to connect to a YubiHSM connector
running on localhost, using the default port.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>url</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – (optional) A http(s):// or yhusb:// backend URL.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A YubiHsm instance connected to the backend referenced by the
url.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.YubiHsm" title="yubihsm.core.YubiHsm">YubiHsm</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.YubiHsm.create_session">
<code class="sig-name descname"><span class="pre">create_session</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">auth_key_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_enc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_mac</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.create_session"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.create_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates an authenticated session with the YubiHSM.</p>
<p>See also create_session_derived, which derives K-ENC and K-MAC from a
password.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>auth_key_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the Authentication key used to
authenticate the session.</p></li>
<li><p><strong>key_enc</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – Static K-ENC used to establish session.</p></li>
<li><p><strong>key_mac</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – Static K-MAC used to establish session.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An authenticated session.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession">AuthSession</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.YubiHsm.create_session_derived">
<code class="sig-name descname"><span class="pre">create_session_derived</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">auth_key_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.create_session_derived"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.create_session_derived" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates an authenticated session with the YubiHSM.</p>
<p>Uses a supplied password to derive the keys K-ENC and K-MAC.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>auth_key_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the Authentication key used to
authenticate the session.</p></li>
<li><p><strong>password</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The password used to derive the keys from.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An authenticated session.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession">AuthSession</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.YubiHsm.get_device_info">
<code class="sig-name descname"><span class="pre">get_device_info</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.get_device_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.get_device_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Get general device information from the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Device information.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#yubihsm.core.DeviceInfo" title="yubihsm.core.DeviceInfo">DeviceInfo</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.core.YubiHsm.send_cmd">
<code class="sig-name descname"><span class="pre">send_cmd</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmd</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">b''</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/core.html#YubiHsm.send_cmd"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.core.YubiHsm.send_cmd" title="Permalink to this definition">¶</a></dt>
<dd><p>Encode and send a command byte and its associated data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmd</strong> (<a class="reference internal" href="#yubihsm.defs.COMMAND" title="yubihsm.defs.COMMAND"><em>COMMAND</em></a>) – The command to send.</p></li>
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The command payload to send.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The response data from the YubiHSM.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-yubihsm.defs">
<span id="yubihsm-defs-module"></span><h2>yubihsm.defs module<a class="headerlink" href="#module-yubihsm.defs" title="Permalink to this headline">¶</a></h2>
<p>Named constants used in YubiHSM commands.</p>
<dl class="py class">
<dt id="yubihsm.defs.ALGORITHM">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">ALGORITHM</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#ALGORITHM"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.ALGORITHM" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>Various algorithm constants</p>
<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES128_CCM_WRAP">
<code class="sig-name descname"><span class="pre">AES128_CCM_WRAP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">29</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES128_CCM_WRAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES128_YUBICO_AUTHENTICATION">
<code class="sig-name descname"><span class="pre">AES128_YUBICO_AUTHENTICATION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">38</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES128_YUBICO_AUTHENTICATION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES128_YUBICO_OTP">
<code class="sig-name descname"><span class="pre">AES128_YUBICO_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">37</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES128_YUBICO_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES192_CCM_WRAP">
<code class="sig-name descname"><span class="pre">AES192_CCM_WRAP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">41</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES192_CCM_WRAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES192_YUBICO_OTP">
<code class="sig-name descname"><span class="pre">AES192_YUBICO_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">39</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES192_YUBICO_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES256_CCM_WRAP">
<code class="sig-name descname"><span class="pre">AES256_CCM_WRAP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">42</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES256_CCM_WRAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.AES256_YUBICO_OTP">
<code class="sig-name descname"><span class="pre">AES256_YUBICO_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">40</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.AES256_YUBICO_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_BP256">
<code class="sig-name descname"><span class="pre">EC_BP256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_BP256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_BP384">
<code class="sig-name descname"><span class="pre">EC_BP384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">17</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_BP384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_BP512">
<code class="sig-name descname"><span class="pre">EC_BP512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">18</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_BP512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ECDH">
<code class="sig-name descname"><span class="pre">EC_ECDH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">24</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ECDH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ECDSA_SHA1">
<code class="sig-name descname"><span class="pre">EC_ECDSA_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">23</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ECDSA_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ECDSA_SHA256">
<code class="sig-name descname"><span class="pre">EC_ECDSA_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">43</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ECDSA_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ECDSA_SHA384">
<code class="sig-name descname"><span class="pre">EC_ECDSA_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">44</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ECDSA_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ECDSA_SHA512">
<code class="sig-name descname"><span class="pre">EC_ECDSA_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">45</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ECDSA_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_ED25519">
<code class="sig-name descname"><span class="pre">EC_ED25519</span></code><em class="property"> <span class="pre">=</span> <span class="pre">46</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_ED25519" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_K256">
<code class="sig-name descname"><span class="pre">EC_K256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">15</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_K256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_P224">
<code class="sig-name descname"><span class="pre">EC_P224</span></code><em class="property"> <span class="pre">=</span> <span class="pre">47</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_P224" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_P256">
<code class="sig-name descname"><span class="pre">EC_P256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">12</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_P256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_P384">
<code class="sig-name descname"><span class="pre">EC_P384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">13</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_P384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.EC_P521">
<code class="sig-name descname"><span class="pre">EC_P521</span></code><em class="property"> <span class="pre">=</span> <span class="pre">14</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.EC_P521" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.HMAC_SHA1">
<code class="sig-name descname"><span class="pre">HMAC_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">19</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.HMAC_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.HMAC_SHA256">
<code class="sig-name descname"><span class="pre">HMAC_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">20</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.HMAC_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.HMAC_SHA384">
<code class="sig-name descname"><span class="pre">HMAC_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">21</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.HMAC_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.HMAC_SHA512">
<code class="sig-name descname"><span class="pre">HMAC_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">22</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.HMAC_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.OPAQUE_DATA">
<code class="sig-name descname"><span class="pre">OPAQUE_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">30</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.OPAQUE_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE">
<code class="sig-name descname"><span class="pre">OPAQUE_X509_CERTIFICATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">31</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_2048">
<code class="sig-name descname"><span class="pre">RSA_2048</span></code><em class="property"> <span class="pre">=</span> <span class="pre">9</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_2048" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_3072">
<code class="sig-name descname"><span class="pre">RSA_3072</span></code><em class="property"> <span class="pre">=</span> <span class="pre">10</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_3072" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_4096">
<code class="sig-name descname"><span class="pre">RSA_4096</span></code><em class="property"> <span class="pre">=</span> <span class="pre">11</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_4096" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_MGF1_SHA1">
<code class="sig-name descname"><span class="pre">RSA_MGF1_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">32</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_MGF1_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_MGF1_SHA256">
<code class="sig-name descname"><span class="pre">RSA_MGF1_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">33</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_MGF1_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_MGF1_SHA384">
<code class="sig-name descname"><span class="pre">RSA_MGF1_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">34</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_MGF1_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_MGF1_SHA512">
<code class="sig-name descname"><span class="pre">RSA_MGF1_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">35</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_MGF1_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_OAEP_SHA1">
<code class="sig-name descname"><span class="pre">RSA_OAEP_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">25</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_OAEP_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_OAEP_SHA256">
<code class="sig-name descname"><span class="pre">RSA_OAEP_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">26</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_OAEP_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_OAEP_SHA384">
<code class="sig-name descname"><span class="pre">RSA_OAEP_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">27</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_OAEP_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_OAEP_SHA512">
<code class="sig-name descname"><span class="pre">RSA_OAEP_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">28</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_OAEP_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA1">
<code class="sig-name descname"><span class="pre">RSA_PKCS1_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA256">
<code class="sig-name descname"><span class="pre">RSA_PKCS1_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA384">
<code class="sig-name descname"><span class="pre">RSA_PKCS1_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA512">
<code class="sig-name descname"><span class="pre">RSA_PKCS1_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PKCS1_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PSS_SHA1">
<code class="sig-name descname"><span class="pre">RSA_PSS_SHA1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PSS_SHA1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PSS_SHA256">
<code class="sig-name descname"><span class="pre">RSA_PSS_SHA256</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PSS_SHA256" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PSS_SHA384">
<code class="sig-name descname"><span class="pre">RSA_PSS_SHA384</span></code><em class="property"> <span class="pre">=</span> <span class="pre">7</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PSS_SHA384" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.RSA_PSS_SHA512">
<code class="sig-name descname"><span class="pre">RSA_PSS_SHA512</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.RSA_PSS_SHA512" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ALGORITHM.TEMPLATE_SSH">
<code class="sig-name descname"><span class="pre">TEMPLATE_SSH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">36</span></em><a class="headerlink" href="#yubihsm.defs.ALGORITHM.TEMPLATE_SSH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.defs.ALGORITHM.for_curve">
<em class="property"><span class="pre">static</span> </em><code class="sig-name descname"><span class="pre">for_curve</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">curve</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#ALGORITHM.for_curve"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.ALGORITHM.for_curve" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a member corresponding to a Cryptography curve instance.</p>
<dl class="field-list simple">
<dt class="field-odd">Example</dt>
<dd class="field-odd"><p></p></dd>
</dl>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ALGORITHM</span><span class="o">.</span><span class="n">for_curve</span><span class="p">(</span><span class="n">ec</span><span class="o">.</span><span class="n">SECP256R1</span><span class="p">())</span> <span class="o">==</span> <span class="n">ALGORITHM</span><span class="o">.</span><span class="n">EC_P256</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.defs.ALGORITHM.to_curve">
<code class="sig-name descname"><span class="pre">to_curve</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#ALGORITHM.to_curve"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.ALGORITHM.to_curve" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a Cryptography EC curve instance for a given member.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The corresponding curve.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>cryptography.hazmat.primitives.ec.</p>
</dd>
<dt class="field-odd">Example</dt>
<dd class="field-odd"><p></p></dd>
</dl>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">isinstance</span><span class="p">(</span><span class="n">ALGORITHM</span><span class="o">.</span><span class="n">EC_P256</span><span class="o">.</span><span class="n">to_curve</span><span class="p">(),</span> <span class="n">ec</span><span class="o">.</span><span class="n">SECP256R1</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.AUDIT">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">AUDIT</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#AUDIT"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.AUDIT" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>Values for audit options</p>
<dl class="py attribute">
<dt id="yubihsm.defs.AUDIT.FIXED">
<code class="sig-name descname"><span class="pre">FIXED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.AUDIT.FIXED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.AUDIT.OFF">
<code class="sig-name descname"><span class="pre">OFF</span></code><em class="property"> <span class="pre">=</span> <span class="pre">0</span></em><a class="headerlink" href="#yubihsm.defs.AUDIT.OFF" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.AUDIT.ON">
<code class="sig-name descname"><span class="pre">ON</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.AUDIT.ON" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.BRAINPOOLP256R1">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">BRAINPOOLP256R1</span></code><a class="reference internal" href="../_modules/yubihsm/defs.html#BRAINPOOLP256R1"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP256R1" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP256R1.key_size">
<code class="sig-name descname"><span class="pre">key_size</span></code><em class="property"> <span class="pre">=</span> <span class="pre">256</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP256R1.key_size" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP256R1.name">
<code class="sig-name descname"><span class="pre">name</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'brainpoolP256r1'</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP256R1.name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.BRAINPOOLP384R1">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">BRAINPOOLP384R1</span></code><a class="reference internal" href="../_modules/yubihsm/defs.html#BRAINPOOLP384R1"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP384R1" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP384R1.key_size">
<code class="sig-name descname"><span class="pre">key_size</span></code><em class="property"> <span class="pre">=</span> <span class="pre">384</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP384R1.key_size" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP384R1.name">
<code class="sig-name descname"><span class="pre">name</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'brainpoolP384r1'</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP384R1.name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.BRAINPOOLP512R1">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">BRAINPOOLP512R1</span></code><a class="reference internal" href="../_modules/yubihsm/defs.html#BRAINPOOLP512R1"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP512R1" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP512R1.key_size">
<code class="sig-name descname"><span class="pre">key_size</span></code><em class="property"> <span class="pre">=</span> <span class="pre">512</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP512R1.key_size" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.BRAINPOOLP512R1.name">
<code class="sig-name descname"><span class="pre">name</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'brainpoolP512r1'</span></em><a class="headerlink" href="#yubihsm.defs.BRAINPOOLP512R1.name" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.CAPABILITY">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">CAPABILITY</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#CAPABILITY"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.CAPABILITY" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>YubiHSM object capability flags</p>
<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.ALL">
<code class="sig-name descname"><span class="pre">ALL</span></code><em class="property"> <span class="pre">=</span> <span class="pre">140737488355327</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.ALL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.CHANGE_AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">CHANGE_AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">70368744177664</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.CHANGE_AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.CREATE_OTP_AEAD">
<code class="sig-name descname"><span class="pre">CREATE_OTP_AEAD</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1073741824</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.CREATE_OTP_AEAD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DECRYPT_OAEP">
<code class="sig-name descname"><span class="pre">DECRYPT_OAEP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1024</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DECRYPT_OAEP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DECRYPT_OTP">
<code class="sig-name descname"><span class="pre">DECRYPT_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">536870912</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DECRYPT_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DECRYPT_PKCS">
<code class="sig-name descname"><span class="pre">DECRYPT_PKCS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">512</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DECRYPT_PKCS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_ASYMMETRIC_KEY">
<code class="sig-name descname"><span class="pre">DELETE_ASYMMETRIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2199023255552</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_ASYMMETRIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">DELETE_AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1099511627776</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_HMAC_KEY">
<code class="sig-name descname"><span class="pre">DELETE_HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8796093022208</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_OPAQUE">
<code class="sig-name descname"><span class="pre">DELETE_OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">549755813888</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">DELETE_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">35184372088832</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_TEMPLATE">
<code class="sig-name descname"><span class="pre">DELETE_TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">17592186044416</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DELETE_WRAP_KEY">
<code class="sig-name descname"><span class="pre">DELETE_WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4398046511104</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DELETE_WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.DERIVE_ECDH">
<code class="sig-name descname"><span class="pre">DERIVE_ECDH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2048</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.DERIVE_ECDH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.EXPORTABLE_UNDER_WRAP">
<code class="sig-name descname"><span class="pre">EXPORTABLE_UNDER_WRAP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">65536</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.EXPORTABLE_UNDER_WRAP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.EXPORT_WRAPPED">
<code class="sig-name descname"><span class="pre">EXPORT_WRAPPED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4096</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.EXPORT_WRAPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GENERATE_ASYMMETRIC_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_ASYMMETRIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GENERATE_ASYMMETRIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GENERATE_HMAC_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2097152</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GENERATE_HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GENERATE_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">68719476736</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GENERATE_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GENERATE_WRAP_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">32768</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GENERATE_WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GET_LOG_ENTRIES">
<code class="sig-name descname"><span class="pre">GET_LOG_ENTRIES</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16777216</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GET_LOG_ENTRIES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GET_OPAQUE">
<code class="sig-name descname"><span class="pre">GET_OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GET_OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GET_OPTION">
<code class="sig-name descname"><span class="pre">GET_OPTION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">262144</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GET_OPTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GET_PSEUDO_RANDOM">
<code class="sig-name descname"><span class="pre">GET_PSEUDO_RANDOM</span></code><em class="property"> <span class="pre">=</span> <span class="pre">524288</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GET_PSEUDO_RANDOM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.GET_TEMPLATE">
<code class="sig-name descname"><span class="pre">GET_TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">67108864</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.GET_TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.IMPORT_WRAPPED">
<code class="sig-name descname"><span class="pre">IMPORT_WRAPPED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8192</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.IMPORT_WRAPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.NONE">
<code class="sig-name descname"><span class="pre">NONE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">0</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.NONE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_ASYMMETRIC">
<code class="sig-name descname"><span class="pre">PUT_ASYMMETRIC</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_ASYMMETRIC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">PUT_AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_HMAC_KEY">
<code class="sig-name descname"><span class="pre">PUT_HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1048576</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_OPAQUE">
<code class="sig-name descname"><span class="pre">PUT_OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">PUT_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">34359738368</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_TEMPLATE">
<code class="sig-name descname"><span class="pre">PUT_TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">134217728</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.PUT_WRAP_KEY">
<code class="sig-name descname"><span class="pre">PUT_WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16384</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.PUT_WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.RANDOMIZE_OTP_AEAD">
<code class="sig-name descname"><span class="pre">RANDOMIZE_OTP_AEAD</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2147483648</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.RANDOMIZE_OTP_AEAD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.RESET_DEVICE">
<code class="sig-name descname"><span class="pre">RESET_DEVICE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">268435456</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.RESET_DEVICE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.REWRAP_FROM_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">REWRAP_FROM_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4294967296</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.REWRAP_FROM_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.REWRAP_TO_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">REWRAP_TO_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8589934592</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.REWRAP_TO_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SET_OPTION">
<code class="sig-name descname"><span class="pre">SET_OPTION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">131072</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SET_OPTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_ATTESTATION_CERTIFICATE">
<code class="sig-name descname"><span class="pre">SIGN_ATTESTATION_CERTIFICATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">17179869184</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_ATTESTATION_CERTIFICATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_ECDSA">
<code class="sig-name descname"><span class="pre">SIGN_ECDSA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">128</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_ECDSA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_EDDSA">
<code class="sig-name descname"><span class="pre">SIGN_EDDSA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">256</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_EDDSA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_HMAC">
<code class="sig-name descname"><span class="pre">SIGN_HMAC</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4194304</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_HMAC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_PKCS">
<code class="sig-name descname"><span class="pre">SIGN_PKCS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">32</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_PKCS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_PSS">
<code class="sig-name descname"><span class="pre">SIGN_PSS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">64</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_PSS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.SIGN_SSH_CERTIFICATE">
<code class="sig-name descname"><span class="pre">SIGN_SSH_CERTIFICATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">33554432</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.SIGN_SSH_CERTIFICATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.UNWRAP_DATA">
<code class="sig-name descname"><span class="pre">UNWRAP_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">274877906944</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.UNWRAP_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.VERIFY_HMAC">
<code class="sig-name descname"><span class="pre">VERIFY_HMAC</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8388608</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.VERIFY_HMAC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.CAPABILITY.WRAP_DATA">
<code class="sig-name descname"><span class="pre">WRAP_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">137438953472</span></em><a class="headerlink" href="#yubihsm.defs.CAPABILITY.WRAP_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.COMMAND">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">COMMAND</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#COMMAND"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.COMMAND" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>Commands available to send to the YubiHSM</p>
<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.AUTHENTICATE_SESSION">
<code class="sig-name descname"><span class="pre">AUTHENTICATE_SESSION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.AUTHENTICATE_SESSION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.BLINK_DEVICE">
<code class="sig-name descname"><span class="pre">BLINK_DEVICE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">107</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.BLINK_DEVICE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.CHANGE_AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">CHANGE_AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">108</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.CHANGE_AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.CLOSE_SESSION">
<code class="sig-name descname"><span class="pre">CLOSE_SESSION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">64</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.CLOSE_SESSION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.CREATE_OTP_AEAD">
<code class="sig-name descname"><span class="pre">CREATE_OTP_AEAD</span></code><em class="property"> <span class="pre">=</span> <span class="pre">97</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.CREATE_OTP_AEAD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.CREATE_SESSION">
<code class="sig-name descname"><span class="pre">CREATE_SESSION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.CREATE_SESSION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DECRYPT_OAEP">
<code class="sig-name descname"><span class="pre">DECRYPT_OAEP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">89</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DECRYPT_OAEP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DECRYPT_OTP">
<code class="sig-name descname"><span class="pre">DECRYPT_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">96</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DECRYPT_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DECRYPT_PKCS1">
<code class="sig-name descname"><span class="pre">DECRYPT_PKCS1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">73</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DECRYPT_PKCS1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DELETE_OBJECT">
<code class="sig-name descname"><span class="pre">DELETE_OBJECT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">88</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DELETE_OBJECT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DERIVE_ECDH">
<code class="sig-name descname"><span class="pre">DERIVE_ECDH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">87</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DERIVE_ECDH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.DEVICE_INFO">
<code class="sig-name descname"><span class="pre">DEVICE_INFO</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.DEVICE_INFO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.ECHO">
<code class="sig-name descname"><span class="pre">ECHO</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.ECHO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.ERROR">
<code class="sig-name descname"><span class="pre">ERROR</span></code><em class="property"> <span class="pre">=</span> <span class="pre">127</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.ERROR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.EXPORT_WRAPPED">
<code class="sig-name descname"><span class="pre">EXPORT_WRAPPED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">74</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.EXPORT_WRAPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GENERATE_ASYMMETRIC_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_ASYMMETRIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">70</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GENERATE_ASYMMETRIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GENERATE_HMAC_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">90</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GENERATE_HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GENERATE_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">102</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GENERATE_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GENERATE_WRAP_KEY">
<code class="sig-name descname"><span class="pre">GENERATE_WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">91</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GENERATE_WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_LOG_ENTRIES">
<code class="sig-name descname"><span class="pre">GET_LOG_ENTRIES</span></code><em class="property"> <span class="pre">=</span> <span class="pre">77</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_LOG_ENTRIES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_OBJECT_INFO">
<code class="sig-name descname"><span class="pre">GET_OBJECT_INFO</span></code><em class="property"> <span class="pre">=</span> <span class="pre">78</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_OBJECT_INFO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_OPAQUE">
<code class="sig-name descname"><span class="pre">GET_OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">67</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_OPTION">
<code class="sig-name descname"><span class="pre">GET_OPTION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">80</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_OPTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_PSEUDO_RANDOM">
<code class="sig-name descname"><span class="pre">GET_PSEUDO_RANDOM</span></code><em class="property"> <span class="pre">=</span> <span class="pre">81</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_PSEUDO_RANDOM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_PUBLIC_KEY">
<code class="sig-name descname"><span class="pre">GET_PUBLIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">84</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_PUBLIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_STORAGE_INFO">
<code class="sig-name descname"><span class="pre">GET_STORAGE_INFO</span></code><em class="property"> <span class="pre">=</span> <span class="pre">65</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_STORAGE_INFO" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.GET_TEMPLATE">
<code class="sig-name descname"><span class="pre">GET_TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">95</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.GET_TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.IMPORT_WRAPPED">
<code class="sig-name descname"><span class="pre">IMPORT_WRAPPED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">75</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.IMPORT_WRAPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.LIST_OBJECTS">
<code class="sig-name descname"><span class="pre">LIST_OBJECTS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">72</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.LIST_OBJECTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_ASYMMETRIC_KEY">
<code class="sig-name descname"><span class="pre">PUT_ASYMMETRIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">69</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_ASYMMETRIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">PUT_AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">68</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_HMAC_KEY">
<code class="sig-name descname"><span class="pre">PUT_HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">82</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_OPAQUE">
<code class="sig-name descname"><span class="pre">PUT_OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">66</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">PUT_OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">101</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_TEMPLATE">
<code class="sig-name descname"><span class="pre">PUT_TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">94</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.PUT_WRAP_KEY">
<code class="sig-name descname"><span class="pre">PUT_WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">76</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.PUT_WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.RANDOMIZE_OTP_AEAD">
<code class="sig-name descname"><span class="pre">RANDOMIZE_OTP_AEAD</span></code><em class="property"> <span class="pre">=</span> <span class="pre">98</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.RANDOMIZE_OTP_AEAD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.RESET_DEVICE">
<code class="sig-name descname"><span class="pre">RESET_DEVICE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.RESET_DEVICE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.REWRAP_OTP_AEAD">
<code class="sig-name descname"><span class="pre">REWRAP_OTP_AEAD</span></code><em class="property"> <span class="pre">=</span> <span class="pre">99</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.REWRAP_OTP_AEAD" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SESSION_MESSAGE">
<code class="sig-name descname"><span class="pre">SESSION_MESSAGE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SESSION_MESSAGE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SET_LOG_INDEX">
<code class="sig-name descname"><span class="pre">SET_LOG_INDEX</span></code><em class="property"> <span class="pre">=</span> <span class="pre">103</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SET_LOG_INDEX" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SET_OPTION">
<code class="sig-name descname"><span class="pre">SET_OPTION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">79</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SET_OPTION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_ATTESTATION_CERTIFICATE">
<code class="sig-name descname"><span class="pre">SIGN_ATTESTATION_CERTIFICATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">100</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_ATTESTATION_CERTIFICATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_ECDSA">
<code class="sig-name descname"><span class="pre">SIGN_ECDSA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">86</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_ECDSA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_EDDSA">
<code class="sig-name descname"><span class="pre">SIGN_EDDSA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">106</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_EDDSA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_HMAC">
<code class="sig-name descname"><span class="pre">SIGN_HMAC</span></code><em class="property"> <span class="pre">=</span> <span class="pre">83</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_HMAC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_PKCS1">
<code class="sig-name descname"><span class="pre">SIGN_PKCS1</span></code><em class="property"> <span class="pre">=</span> <span class="pre">71</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_PKCS1" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_PSS">
<code class="sig-name descname"><span class="pre">SIGN_PSS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">85</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_PSS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.SIGN_SSH_CERTIFICATE">
<code class="sig-name descname"><span class="pre">SIGN_SSH_CERTIFICATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">93</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.SIGN_SSH_CERTIFICATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.UNWRAP_DATA">
<code class="sig-name descname"><span class="pre">UNWRAP_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">105</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.UNWRAP_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.VERIFY_HMAC">
<code class="sig-name descname"><span class="pre">VERIFY_HMAC</span></code><em class="property"> <span class="pre">=</span> <span class="pre">92</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.VERIFY_HMAC" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.COMMAND.WRAP_DATA">
<code class="sig-name descname"><span class="pre">WRAP_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">104</span></em><a class="headerlink" href="#yubihsm.defs.COMMAND.WRAP_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.ERROR">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">ERROR</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#ERROR"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.ERROR" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>Error codes returned by the YubiHSM</p>
<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.AUTHENTICATION_FAILED">
<code class="sig-name descname"><span class="pre">AUTHENTICATION_FAILED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.AUTHENTICATION_FAILED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.COMMAND_UNEXECUTED">
<code class="sig-name descname"><span class="pre">COMMAND_UNEXECUTED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">255</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.COMMAND_UNEXECUTED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.DEMO_MODE">
<code class="sig-name descname"><span class="pre">DEMO_MODE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.DEMO_MODE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INSUFFICIENT_PERMISSIONS">
<code class="sig-name descname"><span class="pre">INSUFFICIENT_PERMISSIONS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">9</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INSUFFICIENT_PERMISSIONS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INVALID_COMMAND">
<code class="sig-name descname"><span class="pre">INVALID_COMMAND</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INVALID_COMMAND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INVALID_DATA">
<code class="sig-name descname"><span class="pre">INVALID_DATA</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INVALID_DATA" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INVALID_ID">
<code class="sig-name descname"><span class="pre">INVALID_ID</span></code><em class="property"> <span class="pre">=</span> <span class="pre">12</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INVALID_ID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INVALID_OTP">
<code class="sig-name descname"><span class="pre">INVALID_OTP</span></code><em class="property"> <span class="pre">=</span> <span class="pre">15</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INVALID_OTP" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.INVALID_SESSION">
<code class="sig-name descname"><span class="pre">INVALID_SESSION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.INVALID_SESSION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.LOG_FULL">
<code class="sig-name descname"><span class="pre">LOG_FULL</span></code><em class="property"> <span class="pre">=</span> <span class="pre">10</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.LOG_FULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.OBJECT_EXISTS">
<code class="sig-name descname"><span class="pre">OBJECT_EXISTS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">17</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.OBJECT_EXISTS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.OBJECT_NOT_FOUND">
<code class="sig-name descname"><span class="pre">OBJECT_NOT_FOUND</span></code><em class="property"> <span class="pre">=</span> <span class="pre">11</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.OBJECT_NOT_FOUND" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.OK">
<code class="sig-name descname"><span class="pre">OK</span></code><em class="property"> <span class="pre">=</span> <span class="pre">0</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.OK" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.SESSIONS_FULL">
<code class="sig-name descname"><span class="pre">SESSIONS_FULL</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.SESSIONS_FULL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.SESSION_FAILED">
<code class="sig-name descname"><span class="pre">SESSION_FAILED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.SESSION_FAILED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.SSH_CA_CONSTRAINT_VIOLATION">
<code class="sig-name descname"><span class="pre">SSH_CA_CONSTRAINT_VIOLATION</span></code><em class="property"> <span class="pre">=</span> <span class="pre">14</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.SSH_CA_CONSTRAINT_VIOLATION" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.STORAGE_FAILED">
<code class="sig-name descname"><span class="pre">STORAGE_FAILED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">7</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.STORAGE_FAILED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ERROR.WRONG_LENGTH">
<code class="sig-name descname"><span class="pre">WRONG_LENGTH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">8</span></em><a class="headerlink" href="#yubihsm.defs.ERROR.WRONG_LENGTH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.LIST_FILTER">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">LIST_FILTER</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#LIST_FILTER"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.LIST_FILTER" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>Keys for use to filter on in list_objects</p>
<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.ALGORITHM">
<code class="sig-name descname"><span class="pre">ALGORITHM</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.ALGORITHM" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.CAPABILITIES">
<code class="sig-name descname"><span class="pre">CAPABILITIES</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.CAPABILITIES" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.DOMAINS">
<code class="sig-name descname"><span class="pre">DOMAINS</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.DOMAINS" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.ID">
<code class="sig-name descname"><span class="pre">ID</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.ID" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.LABEL">
<code class="sig-name descname"><span class="pre">LABEL</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.LABEL" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.LIST_FILTER.TYPE">
<code class="sig-name descname"><span class="pre">TYPE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.LIST_FILTER.TYPE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.OBJECT">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">OBJECT</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#OBJECT"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.OBJECT" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>YubiHSM object types</p>
<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.ASYMMETRIC_KEY">
<code class="sig-name descname"><span class="pre">ASYMMETRIC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.ASYMMETRIC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.AUTHENTICATION_KEY">
<code class="sig-name descname"><span class="pre">AUTHENTICATION_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.AUTHENTICATION_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.HMAC_KEY">
<code class="sig-name descname"><span class="pre">HMAC_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.HMAC_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.OPAQUE">
<code class="sig-name descname"><span class="pre">OPAQUE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.OPAQUE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.OTP_AEAD_KEY">
<code class="sig-name descname"><span class="pre">OTP_AEAD_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">7</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.OTP_AEAD_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.TEMPLATE">
<code class="sig-name descname"><span class="pre">TEMPLATE</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.TEMPLATE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OBJECT.WRAP_KEY">
<code class="sig-name descname"><span class="pre">WRAP_KEY</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.defs.OBJECT.WRAP_KEY" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.OPTION">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">OPTION</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/defs.html#OPTION"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.OPTION" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">enum.IntEnum</span></code></a></p>
<p>YubiHSM device options</p>
<dl class="py attribute">
<dt id="yubihsm.defs.OPTION.COMMAND_AUDIT">
<code class="sig-name descname"><span class="pre">COMMAND_AUDIT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.defs.OPTION.COMMAND_AUDIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.OPTION.FORCE_AUDIT">
<code class="sig-name descname"><span class="pre">FORCE_AUDIT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.OPTION.FORCE_AUDIT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.defs.ORIGIN">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.defs.</span></code><code class="sig-name descname"><span class="pre">ORIGIN</span></code><a class="reference internal" href="../_modules/yubihsm/defs.html#ORIGIN"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.defs.ORIGIN" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a></p>
<dl class="py attribute">
<dt id="yubihsm.defs.ORIGIN.GENERATED">
<code class="sig-name descname"><span class="pre">GENERATED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.defs.ORIGIN.GENERATED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ORIGIN.IMPORTED">
<code class="sig-name descname"><span class="pre">IMPORTED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.defs.ORIGIN.IMPORTED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.defs.ORIGIN.IMPORTED_WRAPPED">
<code class="sig-name descname"><span class="pre">IMPORTED_WRAPPED</span></code><em class="property"> <span class="pre">=</span> <span class="pre">16</span></em><a class="headerlink" href="#yubihsm.defs.ORIGIN.IMPORTED_WRAPPED" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.defs.ORIGIN.generated">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">generated</span></code><a class="headerlink" href="#yubihsm.defs.ORIGIN.generated" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.defs.ORIGIN.imported">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">imported</span></code><a class="headerlink" href="#yubihsm.defs.ORIGIN.imported" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.defs.ORIGIN.wrapped">
<em class="property"><span class="pre">property</span> </em><code class="sig-name descname"><span class="pre">wrapped</span></code><a class="headerlink" href="#yubihsm.defs.ORIGIN.wrapped" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
<div class="section" id="module-yubihsm.eddsa">
<span id="yubihsm-eddsa-module"></span><h2>yubihsm.eddsa module<a class="headerlink" href="#module-yubihsm.eddsa" title="Permalink to this headline">¶</a></h2>
<p>Functions for serializing and deserializing Ed25519 keys.</p>
<dl class="py function">
<dt id="yubihsm.eddsa.load_ed25519_private_key">
<code class="sig-prename descclassname"><span class="pre">yubihsm.eddsa.</span></code><code class="sig-name descname"><span class="pre">load_ed25519_private_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/eddsa.html#load_ed25519_private_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.eddsa.load_ed25519_private_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Load an Ed25519 key from a private seed (32 bytes).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>seed</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – A 32 byte seed.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An Ed25519 private key object.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt id="yubihsm.eddsa.serialize_ed25519_public_key">
<code class="sig-prename descclassname"><span class="pre">yubihsm.eddsa.</span></code><code class="sig-name descname"><span class="pre">serialize_ed25519_public_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/eddsa.html#serialize_ed25519_public_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.eddsa.serialize_ed25519_public_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Serialize an Ed25519 public key object to bytes.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>key</strong> (<em>Ed25519</em>) – The public key to serialze.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The 32 byte binary representation of a public Ed25519 key.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-yubihsm.exceptions">
<span id="yubihsm-exceptions-module"></span><h2>yubihsm.exceptions module<a class="headerlink" href="#module-yubihsm.exceptions" title="Permalink to this headline">¶</a></h2>
<p>Exceptions thrown by this library.</p>
<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmAuthenticationError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmAuthenticationError</span></code><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmAuthenticationError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmAuthenticationError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.exceptions.YubiHsmError" title="yubihsm.exceptions.YubiHsmError"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.exceptions.YubiHsmError</span></code></a></p>
<p>Authentication failed.</p>
</dd></dl>

<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmConnectionError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmConnectionError</span></code><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmConnectionError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmConnectionError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.exceptions.YubiHsmError" title="yubihsm.exceptions.YubiHsmError"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.exceptions.YubiHsmError</span></code></a></p>
<p>The connection to the YubiHSM failed.</p>
</dd></dl>

<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmDeviceError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmDeviceError</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">code</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmDeviceError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmDeviceError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.exceptions.YubiHsmError" title="yubihsm.exceptions.YubiHsmError"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.exceptions.YubiHsmError</span></code></a></p>
<p>The YubiHSM returned an error code.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>code</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The device error code.</p>
</dd>
</dl>
</dd></dl>

<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmError</span></code><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/exceptions.html#Exception" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></a></p>
<p>Baseclass for YubiHSM errors.</p>
</dd></dl>

<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmInvalidRequestError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmInvalidRequestError</span></code><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmInvalidRequestError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmInvalidRequestError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.exceptions.YubiHsmError" title="yubihsm.exceptions.YubiHsmError"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.exceptions.YubiHsmError</span></code></a></p>
<p>The request was not able to be sent to the YubiHSM.</p>
</dd></dl>

<dl class="py exception">
<dt id="yubihsm.exceptions.YubiHsmInvalidResponseError">
<em class="property"><span class="pre">exception</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.exceptions.</span></code><code class="sig-name descname"><span class="pre">YubiHsmInvalidResponseError</span></code><a class="reference internal" href="../_modules/yubihsm/exceptions.html#YubiHsmInvalidResponseError"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.exceptions.YubiHsmInvalidResponseError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.exceptions.YubiHsmError" title="yubihsm.exceptions.YubiHsmError"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.exceptions.YubiHsmError</span></code></a></p>
<p>The YubiHSM returned an unexpected response.</p>
</dd></dl>

</div>
<div class="section" id="module-yubihsm.objects">
<span id="yubihsm-objects-module"></span><h2>yubihsm.objects module<a class="headerlink" href="#module-yubihsm.objects" title="Permalink to this headline">¶</a></h2>
<p>Classes for interacting with objects on a YubiHSM.</p>
<dl class="py class">
<dt id="yubihsm.objects.AsymmetricKey">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">AsymmetricKey</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Used to sign/decrypt data with the private key of an asymmetric key pair.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.RSA_2048" title="yubihsm.defs.ALGORITHM.RSA_2048"><code class="xref py py-class docutils literal notranslate"><span class="pre">RSA_2048</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.RSA_3072" title="yubihsm.defs.ALGORITHM.RSA_3072"><code class="xref py py-class docutils literal notranslate"><span class="pre">RSA_3072</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.RSA_4096" title="yubihsm.defs.ALGORITHM.RSA_4096"><code class="xref py py-class docutils literal notranslate"><span class="pre">RSA_4096</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_P224" title="yubihsm.defs.ALGORITHM.EC_P224"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_P224</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_P256" title="yubihsm.defs.ALGORITHM.EC_P256"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_P256</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_P384" title="yubihsm.defs.ALGORITHM.EC_P384"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_P384</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_P521" title="yubihsm.defs.ALGORITHM.EC_P521"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_P521</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_K256" title="yubihsm.defs.ALGORITHM.EC_K256"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_K256</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_BP256" title="yubihsm.defs.ALGORITHM.EC_BP256"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_BP256</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_BP384" title="yubihsm.defs.ALGORITHM.EC_BP384"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_BP384</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_BP512" title="yubihsm.defs.ALGORITHM.EC_BP512"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_BP512</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.EC_ED25519" title="yubihsm.defs.ALGORITHM.EC_ED25519"><code class="xref py py-class docutils literal notranslate"><span class="pre">EC_ED25519</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.attest">
<code class="sig-name descname"><span class="pre">attest</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">attesting_key_id</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.attest"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.attest" title="Permalink to this definition">¶</a></dt>
<dd><p>Attest this asymmetric key.</p>
<p>Creates an X509 certificate containing this key pair’s public key,
signed by the asymmetric key identified by the given ID.
You also need a X509 certificate stored with the same ID as the
attesting key in the YubiHSM, to be used as a template.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>attesting_key_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – (optional) The ID of the asymmetric key
used to attest. If omitted, the built-in Yubico attestation key is
used.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The attestation certificate.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate" title="(in Cryptography v35.0.0.dev1)">cryptography.x509.Certificate</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.decrypt_oaep">
<code class="sig-name descname"><span class="pre">decrypt_oaep</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">data</span></em>, <em class="sig-param"><span class="pre">label=b''</span></em>, <em class="sig-param"><span class="pre">hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em>, <em class="sig-param"><span class="pre">mgf_hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.decrypt_oaep"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.decrypt_oaep" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrypt data encrypted with RSAES-OAEP.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The ciphertext to decrypt.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – (optional) OAEP label.</p></li>
<li><p><strong>hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use when hashing the data.</p></li>
<li><p><strong>mgf_hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use for MGF1.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The decrypted plaintext.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.decrypt_pkcs1v1_5">
<code class="sig-name descname"><span class="pre">decrypt_pkcs1v1_5</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.decrypt_pkcs1v1_5"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.decrypt_pkcs1v1_5" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrypt data encrypted with RSAES-PKCS1-v1_5.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The ciphertext to decrypt.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The decrypted plaintext.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.derive_ecdh">
<code class="sig-name descname"><span class="pre">derive_ecdh</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">public_key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.derive_ecdh"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.derive_ecdh" title="Permalink to this definition">¶</a></dt>
<dd><p>Perform an ECDH key exchange as specified in SP 800-56A.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>public_key</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey</em></a>) – The public key to use for the key exchange.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The resulting shared key.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.generate">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">generate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.generate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a new private key in the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the private key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.AsymmetricKey" title="yubihsm.objects.AsymmetricKey">AsymmetricKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.get_certificate">
<code class="sig-name descname"><span class="pre">get_certificate</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.get_certificate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.get_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the X509 certificate associated with the key.</p>
<p>An X509 certificate is associated with an asymmetric key if it is stored
as an Opaque object with the same object ID as the key, and it has the
<a class="reference internal" href="#yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE" title="yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE"><code class="xref py py-class docutils literal notranslate"><span class="pre">OPAQUE_X509_CERTIFICATE</span></code></a> algorithm set.</p>
<p>Equivalent to calling <cite>Opaque(session, key_id).get_certificate()</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The certificate stored for the object.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate" title="(in Cryptography v35.0.0.dev1)">cryptography.x509.Certificate</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.get_public_key">
<code class="sig-name descname"><span class="pre">get_public_key</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.get_public_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.get_public_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the public key of the key pair.</p>
<p>This will return either a
<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey" title="(in Cryptography v35.0.0.dev1)"><code class="xref py py-class docutils literal notranslate"><span class="pre">RSAPublicKey</span></code></a>
or a
<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey" title="(in Cryptography v35.0.0.dev1)"><code class="xref py py-class docutils literal notranslate"><span class="pre">EllipticCurvePublicKey</span></code></a>
depending on the algorithm of the key.</p>
<p>Ed25519 keys will be returned as a Cryptography
<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ed25519/#cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey" title="(in Cryptography v35.0.0.dev1)"><code class="xref py py-class docutils literal notranslate"><span class="pre">Ed25519PublicKey</span></code></a>
object if possible (requires Cryptography 2.6 or later), or an internal
representation if not, either which can be serialized using the
<a class="reference internal" href="#yubihsm.eddsa.serialize_ed25519_public_key" title="yubihsm.eddsa.serialize_ed25519_public_key"><code class="xref py py-func docutils literal notranslate"><span class="pre">serialize_ed25519_public_key()</span></code></a> function.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The public key of the key pair.</p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.AsymmetricKey.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">3</span></em><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import a private key into the YubiHSM.</p>
<p>RSA and EC keys can be created by using the cryptography APIs. You can
then pass either a
<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKey" title="(in Cryptography v35.0.0.dev1)"><code class="xref py py-class docutils literal notranslate"><span class="pre">RSAPrivateKey</span></code></a>
or a
<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/asymmetric/ec/#cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKey" title="(in Cryptography v35.0.0.dev1)"><code class="xref py py-class docutils literal notranslate"><span class="pre">EllipticCurvePrivateKey</span></code></a>
as <cite>key</cite>.</p>
<p>EdDSA keys can be created using the Cryptography APIs if available, or
by calling
<a class="reference internal" href="#yubihsm.eddsa.load_ed25519_private_key" title="yubihsm.eddsa.load_ed25519_private_key"><code class="xref py py-func docutils literal notranslate"><span class="pre">load_ed25519_private_key()</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>key</strong> – The private key to import.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.AsymmetricKey" title="yubihsm.objects.AsymmetricKey">AsymmetricKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.put_certificate">
<code class="sig-name descname"><span class="pre">put_certificate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">certificate</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.put_certificate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.put_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Store an X509 certificate associated with this key.</p>
<p>Equivalent to calling <cite>Opaque.put_certificate(session, key_id, …)</cite>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>certificate</strong> (<a class="reference external" href="https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.x509.Certificate</em></a>) – A certificate to
import.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.Opaque" title="yubihsm.objects.Opaque">Opaque</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.sign_ecdsa">
<code class="sig-name descname"><span class="pre">sign_ecdsa</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">data</span></em>, <em class="sig-param"><span class="pre">hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em>, <em class="sig-param"><span class="pre">length=0</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.sign_ecdsa"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.sign_ecdsa" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign data using ECDSA.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to sign.</p></li>
<li><p><strong>hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use when hashing the data.</p></li>
<li><p><strong>length</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – (optional) length to pad/truncate the hash to.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The resulting signature.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.sign_eddsa">
<code class="sig-name descname"><span class="pre">sign_eddsa</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.sign_eddsa"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.sign_eddsa" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign data using EdDSA.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to sign.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The resulting signature.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.sign_pkcs1v1_5">
<code class="sig-name descname"><span class="pre">sign_pkcs1v1_5</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">data</span></em>, <em class="sig-param"><span class="pre">hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.sign_pkcs1v1_5"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.sign_pkcs1v1_5" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign data using RSASSA-PKCS1-v1_5.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to sign.</p></li>
<li><p><strong>hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use when hashing the data.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The resulting signature.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.sign_pss">
<code class="sig-name descname"><span class="pre">sign_pss</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">data</span></em>, <em class="sig-param"><span class="pre">salt_len</span></em>, <em class="sig-param"><span class="pre">hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em>, <em class="sig-param"><span class="pre">mgf_hash=&lt;cryptography.hazmat.primitives.hashes.SHA256</span> <span class="pre">object&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.sign_pss"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.sign_pss" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign data using RSASSA-PSS with MGF1.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to sign.</p></li>
<li><p><strong>salt_len</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The length of the salt to use.</p></li>
<li><p><strong>hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use when hashing the data.</p></li>
<li><p><strong>mgf_hash</strong> (<a class="reference external" href="https://cryptography.io/en/latest/hazmat/primitives/cryptographic-hashes/#cryptography.hazmat.primitives.hashes.HashAlgorithm" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.hazmat.primitives.hashes.HashAlgorithm</em></a>) – (optional) The algorithm to use for MGF1.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The resulting signature.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AsymmetricKey.sign_ssh_certificate">
<code class="sig-name descname"><span class="pre">sign_ssh_certificate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">template_id</span></em>, <em class="sig-param"><span class="pre">request</span></em>, <em class="sig-param"><span class="pre">algorithm=&lt;ALGORITHM.RSA_PKCS1_SHA1:</span> <span class="pre">1&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AsymmetricKey.sign_ssh_certificate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AsymmetricKey.sign_ssh_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Sign an SSH certificate request.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>template_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the SSH TEMPLATE to use.</p></li>
<li><p><strong>request</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The SSH certificate request.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The signed SSH certificate.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.AuthenticationKey">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">AuthenticationKey</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AuthenticationKey"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AuthenticationKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Used to authenticate a session with the YubiHSM.</p>
<p>AuthenticationKeys use two separate keys to mutually authenticate and set up
a secure session with a YubiHSM. These two keys can either be given
explicitly, or be derived from a password.</p>
<dl class="py method">
<dt id="yubihsm.objects.AuthenticationKey.change_key">
<code class="sig-name descname"><span class="pre">change_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key_enc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_mac</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AuthenticationKey.change_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AuthenticationKey.change_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the raw keys used to authenticate a session.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key_enc</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw encryption key.</p></li>
<li><p><strong>key_mac</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw MAC key.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AuthenticationKey.change_password">
<code class="sig-name descname"><span class="pre">change_password</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AuthenticationKey.change_password"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AuthenticationKey.change_password" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the password used to authenticate a session.</p>
<p>Changes the raw keys used for authentication, by deriving them from a
password.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>password</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The password to derive raw keys from.</p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.AuthenticationKey.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">2</span></em><a class="headerlink" href="#yubihsm.objects.AuthenticationKey.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AuthenticationKey.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delegated_capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_enc</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key_mac</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AuthenticationKey.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AuthenticationKey.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an AuthenticationKey by providing raw keys.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>delegated_capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities that the
AuthenticationKey can give to objects created when authenticated
using it.</p></li>
<li><p><strong>key_enc</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw encryption key.</p></li>
<li><p><strong>key_mac</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw MAC key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.AuthenticationKey" title="yubihsm.objects.AuthenticationKey">AuthenticationKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.AuthenticationKey.put_derived">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put_derived</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delegated_capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#AuthenticationKey.put_derived"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.AuthenticationKey.put_derived" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an AuthenticationKey derived from a password.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>delegated_capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities that the
AuthenticationKey can give to objects created when authenticated
using it.</p></li>
<li><p><strong>password</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – The password to derive raw keys from.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.AuthenticationKey" title="yubihsm.objects.AuthenticationKey">AuthenticationKey</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.HmacKey">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">HmacKey</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#HmacKey"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.HmacKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Used to calculate and verify HMAC signatures.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.HMAC_SHA1" title="yubihsm.defs.ALGORITHM.HMAC_SHA1"><code class="xref py py-class docutils literal notranslate"><span class="pre">HMAC_SHA1</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.HMAC_SHA256" title="yubihsm.defs.ALGORITHM.HMAC_SHA256"><code class="xref py py-class docutils literal notranslate"><span class="pre">HMAC_SHA256</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.HMAC_SHA384" title="yubihsm.defs.ALGORITHM.HMAC_SHA384"><code class="xref py py-class docutils literal notranslate"><span class="pre">HMAC_SHA384</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.HMAC_SHA512" title="yubihsm.defs.ALGORITHM.HMAC_SHA512"><code class="xref py py-class docutils literal notranslate"><span class="pre">HMAC_SHA512</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.HmacKey.generate">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">generate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">session</span></em>, <em class="sig-param"><span class="pre">object_id</span></em>, <em class="sig-param"><span class="pre">label</span></em>, <em class="sig-param"><span class="pre">domains</span></em>, <em class="sig-param"><span class="pre">capabilities</span></em>, <em class="sig-param"><span class="pre">algorithm=&lt;ALGORITHM.HMAC_SHA256:</span> <span class="pre">20&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#HmacKey.generate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.HmacKey.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a new HMAC key in the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – (optional) The algorithm to use for the HMAC
key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.HmacKey" title="yubihsm.objects.HmacKey">HmacKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.HmacKey.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">5</span></em><a class="headerlink" href="#yubihsm.objects.HmacKey.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.HmacKey.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="pre">session</span></em>, <em class="sig-param"><span class="pre">object_id</span></em>, <em class="sig-param"><span class="pre">label</span></em>, <em class="sig-param"><span class="pre">domains</span></em>, <em class="sig-param"><span class="pre">capabilities</span></em>, <em class="sig-param"><span class="pre">key</span></em>, <em class="sig-param"><span class="pre">algorithm=&lt;ALGORITHM.HMAC_SHA256:</span> <span class="pre">20&gt;</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#HmacKey.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.HmacKey.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import an HMAC key into the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw key corresponding to the algorithm.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – (optional) The algorithm to use for the HMAC
key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.HmacKey" title="yubihsm.objects.HmacKey">HmacKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.HmacKey.sign_hmac">
<code class="sig-name descname"><span class="pre">sign_hmac</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#HmacKey.sign_hmac"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.HmacKey.sign_hmac" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate the HMAC signature of the given data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to sign.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The signature.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.HmacKey.verify_hmac">
<code class="sig-name descname"><span class="pre">verify_hmac</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">signature</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#HmacKey.verify_hmac"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.HmacKey.verify_hmac" title="Permalink to this definition">¶</a></dt>
<dd><p>Verify an HMAC signature.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>signature</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The signature to verify.</p></li>
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to verify the signature against.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>True if verification succeeded, False if not.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.9)">bool</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.ObjectInfo">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">ObjectInfo</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">size</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_type</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sequence</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">origin</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delegated_capabilities</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#ObjectInfo"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.ObjectInfo" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.ObjectInfo" title="yubihsm.objects.ObjectInfo"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.ObjectInfo</span></code></a></p>
<p>Data structure holding various information about an object.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The capabilities of the object.</p></li>
<li><p><strong>id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the object.</p></li>
<li><p><strong>size</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The size of the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains the object belongs to.</p></li>
<li><p><strong>object_type</strong> (<a class="reference internal" href="#yubihsm.defs.OBJECT" title="yubihsm.defs.OBJECT"><em>OBJECT</em></a>) – The type of the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm of the object.</p></li>
<li><p><strong>sequence</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The sequence number of the object.</p></li>
<li><p><strong>origin</strong> (<a class="reference internal" href="#yubihsm.defs.ORIGIN" title="yubihsm.defs.ORIGIN"><em>ORIGIN</em></a>) – How the object was created/imported.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a><em> or </em><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The label of the object.</p></li>
<li><p><strong>delegated_capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of delegated capabilities for the
object.</p></li>
</ul>
</dd>
</dl>
<dl class="py attribute">
<dt id="yubihsm.objects.ObjectInfo.FORMAT">
<code class="sig-name descname"><span class="pre">FORMAT</span></code><em class="property"> <span class="pre">=</span> <span class="pre">'!QHHHBBBB40sQ'</span></em><a class="headerlink" href="#yubihsm.objects.ObjectInfo.FORMAT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.ObjectInfo.LENGTH">
<code class="sig-name descname"><span class="pre">LENGTH</span></code><em class="property"> <span class="pre">=</span> <span class="pre">66</span></em><a class="headerlink" href="#yubihsm.objects.ObjectInfo.LENGTH" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.ObjectInfo.parse">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">parse</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#ObjectInfo.parse"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.ObjectInfo.parse" title="Permalink to this definition">¶</a></dt>
<dd><p>Parse an ObjectInfo from its binary representation.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.Opaque">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">Opaque</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Opaque"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Opaque" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Object used to store arbitrary data on the YubiHSM.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.OPAQUE_DATA" title="yubihsm.defs.ALGORITHM.OPAQUE_DATA"><code class="xref py py-class docutils literal notranslate"><span class="pre">OPAQUE_DATA</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE" title="yubihsm.defs.ALGORITHM.OPAQUE_X509_CERTIFICATE"><code class="xref py py-class docutils literal notranslate"><span class="pre">OPAQUE_X509_CERTIFICATE</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.Opaque.get">
<code class="sig-name descname"><span class="pre">get</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Opaque.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Opaque.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Read the data of an Opaque object from the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The data stored for the object.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.Opaque.get_certificate">
<code class="sig-name descname"><span class="pre">get_certificate</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Opaque.get_certificate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Opaque.get_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Read an Opaque object from the YubiHSM, parsed as a certificate.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The certificate stored for the object.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate" title="(in Cryptography v35.0.0.dev1)">cryptography.x509.Certificate</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.Opaque.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">1</span></em><a class="headerlink" href="#yubihsm.objects.Opaque.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.Opaque.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Opaque.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Opaque.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import an Opaque object into the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the object.</p></li>
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The binary data to store.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.Opaque" title="yubihsm.objects.Opaque">Opaque</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.Opaque.put_certificate">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put_certificate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">certificate</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Opaque.put_certificate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Opaque.put_certificate" title="Permalink to this definition">¶</a></dt>
<dd><p>Import an X509 certificate into the YubiHSM as an Opaque.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>certificate</strong> (<a class="reference external" href="https://cryptography.io/en/latest/x509/reference/#cryptography.x509.Certificate" title="(in Cryptography v35.0.0.dev1)"><em>cryptography.x509.Certificate</em></a>) – A certificate to
import.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.Opaque" title="yubihsm.objects.Opaque">Opaque</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.OtpAeadKey">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">OtpAeadKey</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Used to decrypt and use a Yubico OTP AEAD for OTP decryption.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES128_YUBICO_OTP" title="yubihsm.defs.ALGORITHM.AES128_YUBICO_OTP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES128_YUBICO_OTP</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES192_YUBICO_OTP" title="yubihsm.defs.ALGORITHM.AES192_YUBICO_OTP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES192_YUBICO_OTP</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES256_YUBICO_OTP" title="yubihsm.defs.ALGORITHM.AES256_YUBICO_OTP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES256_YUBICO_OTP</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.create_otp_aead">
<code class="sig-name descname"><span class="pre">create_otp_aead</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">identity</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.create_otp_aead"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.create_otp_aead" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new Yubico OTP credential AEAD.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – 16 byte AES key for the credential.</p></li>
<li><p><strong>identity</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – 6 byte private ID for the credential.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A new AEAD.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.decrypt_otp">
<code class="sig-name descname"><span class="pre">decrypt_otp</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">aead</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">otp</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.decrypt_otp"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.decrypt_otp" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrypt a Yubico OTP using an AEAD.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>aead</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The AEAD containing encrypted credential data.</p></li>
<li><p><strong>otp</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The 16 byte encrypted OTP payload to decrypt.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The decrypted OTP data.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.OtpData" title="yubihsm.objects.OtpData">OtpData</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.generate">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">generate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nonce_id</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.generate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a new OTP AEAD key in the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.OtpAeadKey" title="yubihsm.objects.OtpAeadKey">OtpAeadKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.OtpAeadKey.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">7</span></em><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nonce_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import an OTP AEAD key into the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the key.</p></li>
<li><p><strong>nonce_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The nonce ID used for AEADs.</p></li>
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The key to import, corresponding to the algorithm.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.AsymmetricKey" title="yubihsm.objects.AsymmetricKey">AsymmetricKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.randomize_otp_aead">
<code class="sig-name descname"><span class="pre">randomize_otp_aead</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.randomize_otp_aead"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.randomize_otp_aead" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new Yubico OTP credential AEAD using random data.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>A new AEAD.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.OtpAeadKey.rewrap_otp_aead">
<code class="sig-name descname"><span class="pre">rewrap_otp_aead</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">new_key_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">aead</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpAeadKey.rewrap_otp_aead"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpAeadKey.rewrap_otp_aead" title="Permalink to this definition">¶</a></dt>
<dd><p>Decrypt and re-encrypt an AEAD from one key to another.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>new_key_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the OtpAeadKey to wrap to.</p></li>
<li><p><strong>aead</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The AEAD to re-wrap.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The new AEAD.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.OtpData">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">OtpData</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">use_counter</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">session_counter</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timestamp_high</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">timestamp_low</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#OtpData"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.OtpData" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.OtpData" title="yubihsm.objects.OtpData"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.OtpData</span></code></a></p>
<p>Decrypted OTP counter values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>use_counter</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – 16 bit counter incremented on each power cycle.</p></li>
<li><p><strong>session_counter</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – 8 bit counter incremented on each touch.</p></li>
<li><p><strong>timestamp_high</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – 8 bit high part of the timestamp.</p></li>
<li><p><strong>timestamp_low</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – 16 bit low part of the timestamp.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.Template">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">Template</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Template"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Template" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Binary template used to validate SSH certificate requests.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.TEMPLATE_SSH" title="yubihsm.defs.ALGORITHM.TEMPLATE_SSH"><code class="xref py py-class docutils literal notranslate"><span class="pre">TEMPLATE_SSH</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.Template.get">
<code class="sig-name descname"><span class="pre">get</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Template.get"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Template.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Read a Template from the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>The template data.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.Template.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">6</span></em><a class="headerlink" href="#yubihsm.objects.Template.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.Template.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#Template.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.Template.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import a Template into the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the template.</p></li>
<li><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The template data.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.Template" title="yubihsm.objects.Template">Template</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.WrapKey">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">WrapKey</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">yubihsm.objects.YhsmObject</span></code></a></p>
<p>Used to import and export other objects under wrap.</p>
<dl class="simple">
<dt>Supported algorithms:</dt><dd><ul class="simple">
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES128_CCM_WRAP" title="yubihsm.defs.ALGORITHM.AES128_CCM_WRAP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES128_CCM_WRAP</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES192_CCM_WRAP" title="yubihsm.defs.ALGORITHM.AES192_CCM_WRAP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES192_CCM_WRAP</span></code></a></p></li>
<li><p><a class="reference internal" href="#yubihsm.defs.ALGORITHM.AES256_CCM_WRAP" title="yubihsm.defs.ALGORITHM.AES256_CCM_WRAP"><code class="xref py py-class docutils literal notranslate"><span class="pre">AES256_CCM_WRAP</span></code></a></p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.WrapKey.export_wrapped">
<code class="sig-name descname"><span class="pre">export_wrapped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">obj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.export_wrapped"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.export_wrapped" title="Permalink to this definition">¶</a></dt>
<dd><p>Exports an object under wrap.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>obj</strong> (<a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject"><em>YhsmObject</em></a>) – The object to export.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The encrypted object data.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.WrapKey.generate">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">generate</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delegated_capabilities</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.generate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.generate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a new wrap key in the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the wrap key.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.WrapKey" title="yubihsm.objects.WrapKey">WrapKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.WrapKey.import_wrapped">
<code class="sig-name descname"><span class="pre">import_wrapped</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">wrapped_obj</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.import_wrapped"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.import_wrapped" title="Permalink to this definition">¶</a></dt>
<dd><p>Imports an object previously exported under wrap.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>wraped_obj</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The encrypted object data.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the imported object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject">YhsmObject</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.WrapKey.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">4</span></em><a class="headerlink" href="#yubihsm.objects.WrapKey.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.WrapKey.put">
<em class="property"><span class="pre">classmethod</span> </em><code class="sig-name descname"><span class="pre">put</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">label</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">domains</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">algorithm</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delegated_capabilities</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">key</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.put"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.put" title="Permalink to this definition">¶</a></dt>
<dd><p>Import a wrap key into the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to import via.</p></li>
<li><p><strong>object_id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID to set for the object. Set to 0 to let the
YubiHSM designate an ID.</p></li>
<li><p><strong>label</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#str" title="(in Python v3.9)"><em>str</em></a>) – A text label to give the object.</p></li>
<li><p><strong>domains</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of domains to assign the object to.</p></li>
<li><p><strong>capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities to give the object.</p></li>
<li><p><strong>algorithm</strong> (<a class="reference internal" href="#yubihsm.defs.ALGORITHM" title="yubihsm.defs.ALGORITHM"><em>ALGORITHM</em></a>) – The algorithm to use for the wrap key.</p></li>
<li><p><strong>delegated_capabilities</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The set of capabilities that the
WrapKey can give to objects that it imports.</p></li>
<li><p><strong>key</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The raw encryption key corresponding to the algorithm.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A reference to the newly created object.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.WrapKey" title="yubihsm.objects.WrapKey">WrapKey</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.WrapKey.unwrap_data">
<code class="sig-name descname"><span class="pre">unwrap_data</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.unwrap_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.unwrap_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Unwrap (decrypt) arbitrary data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The encrypted data to decrypt.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The decrypted data.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.WrapKey.wrap_data">
<code class="sig-name descname"><span class="pre">wrap_data</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">data</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#WrapKey.wrap_data"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.WrapKey.wrap_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Wrap (encrypt) arbitrary data.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> (<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)"><em>bytes</em></a>) – The data to encrypt.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The encrypted data.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt id="yubihsm.objects.YhsmObject">
<em class="property"><span class="pre">class</span> </em><code class="sig-prename descclassname"><span class="pre">yubihsm.objects.</span></code><code class="sig-name descname"><span class="pre">YhsmObject</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">object_id</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seq</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#YhsmObject"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.YhsmObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.9)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A reference to an object stored in a YubiHSM.</p>
<p>YubiHSM objects are uniquely identified by their type and ID combined.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>object_type</strong> (<a class="reference internal" href="#yubihsm.defs.OBJECT" title="yubihsm.defs.OBJECT"><em>OBJECT</em></a>) – The type of the object.</p></li>
<li><p><strong>id</strong> (<a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.9)"><em>int</em></a>) – The ID of the object.</p></li>
<li><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to use for YubiHSM communication.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt id="yubihsm.objects.YhsmObject.delete">
<code class="sig-name descname"><span class="pre">delete</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#YhsmObject.delete"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.YhsmObject.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Deletes the object from the YubiHSM.</p>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>This action in irreversible.</p>
</div>
</dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.YhsmObject.get_info">
<code class="sig-name descname"><span class="pre">get_info</span></code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#YhsmObject.get_info"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.YhsmObject.get_info" title="Permalink to this definition">¶</a></dt>
<dd><p>Read extended information about the object from the YubiHSM.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>Information about the object.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference internal" href="#yubihsm.objects.ObjectInfo" title="yubihsm.objects.ObjectInfo">ObjectInfo</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py attribute">
<dt id="yubihsm.objects.YhsmObject.object_type">
<code class="sig-name descname"><span class="pre">object_type</span></code><em class="property"> <span class="pre">=</span> <span class="pre">None</span></em><a class="headerlink" href="#yubihsm.objects.YhsmObject.object_type" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py method">
<dt id="yubihsm.objects.YhsmObject.with_session">
<code class="sig-name descname"><span class="pre">with_session</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">session</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/objects.html#YhsmObject.with_session"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.objects.YhsmObject.with_session" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a copy of the object reference, using the given session.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>session</strong> (<a class="reference internal" href="#yubihsm.core.AuthSession" title="yubihsm.core.AuthSession"><em>AuthSession</em></a>) – The session to use for the created reference.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A new reference to the object, associated wth the given session.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p><a class="reference internal" href="#yubihsm.objects.YhsmObject" title="yubihsm.objects.YhsmObject">YhsmObject</a></p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-yubihsm.utils">
<span id="yubihsm-utils-module"></span><h2>yubihsm.utils module<a class="headerlink" href="#module-yubihsm.utils" title="Permalink to this headline">¶</a></h2>
<p>Various utility functions used throughout the library.</p>
<dl class="py function">
<dt id="yubihsm.utils.int_from_bytes">
<code class="sig-prename descclassname"><span class="pre">yubihsm.utils.</span></code><code class="sig-name descname"><span class="pre">int_from_bytes</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">byteorder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'big'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/utils.html#int_from_bytes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.utils.int_from_bytes" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py function">
<dt id="yubihsm.utils.password_to_key">
<code class="sig-prename descclassname"><span class="pre">yubihsm.utils.</span></code><code class="sig-name descname"><span class="pre">password_to_key</span></code><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">password</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/yubihsm/utils.html#password_to_key"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#yubihsm.utils.password_to_key" title="Permalink to this definition">¶</a></dt>
<dd><p>Derive keys for establishing a YubiHSM session from a password.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>A tuple containing the encryption key, and MAC key.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p><a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#tuple" title="(in Python v3.9)">tuple</a>[<a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a>, <a class="reference external" href="https://docs.python.org/3/library/stdtypes.html#bytes" title="(in Python v3.9)">bytes</a>]</p>
</dd>
</dl>
</dd></dl>

</div>
<div class="section" id="module-yubihsm">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-yubihsm" title="Permalink to this headline">¶</a></h2>
<p>Contains the main YubiHsm class used to connect to a YubiHSM device.</p>
<p>See <a class="reference internal" href="#yubihsm.core.YubiHsm" title="yubihsm.core.YubiHsm"><code class="xref py py-class docutils literal notranslate"><span class="pre">YubiHsm</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Example</dt>
<dd class="field-odd"><p></p></dd>
</dl>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">yubihsm</span> <span class="kn">import</span> <span class="n">YubiHsm</span>
<span class="gp">... </span><span class="n">hsm</span> <span class="o">=</span> <span class="n">YubiHsm</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="s1">&#39;http://localhost:12345&#39;</span><span class="p">)</span>
<span class="gp">... </span><span class="n">session</span> <span class="o">=</span> <span class="n">hsm</span><span class="o">.</span><span class="n">create_session_derived</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="s1">&#39;password&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>


           </div>
           
          </div>
          <footer>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2018, Yubico.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>